SPI can communicate with multiple slaves using different connection methods:
1. Multidrop Configuration (Most Common)
- Shared lines: MISO, MOSI, and SCLK are shared by all slaves.
- Individual SS lines: Each slave has its own SS (slave select).
- Tri-state MISO:
- Slaves must tri-state their MISO when not selected to avoid bus contention.
- If a slave does not support tri-state → use an external tri-state buffer controlled by SS.
Important:
- All SS lines should start HIGH before communication begins.
- If SS is controlled by GPIOs, configure them as outputs set HIGH before any initialization code runs.
- Optional: Add pull-up resistors to ensure SS defaults HIGH on power-up.

2. Daisy Chain Configuration
- Connection:
- Master MOSI → Slave 1 input
- Slave 1 output → Slave 2 input
- … until final slave output → Master MISO
- Effect: Combines all slave shift registers into one long shift register.
- Advantage:
- Only one SS line needed for all slaves.
- Ideal for devices that support daisy-chaining (e.g., shift registers).
Use Cases:
- Parallel-in/serial-out shift registers (e.g. 74xx165).
- Serial-in/parallel-out shift registers (e.g. 74xx595).
- Can integrate with protocols like SGPIO, JTAG, I²C for special applications.

3. Expander Configuration
- Uses SPI-controlled addressing units (e.g., binary decoders, demux, or shift registers) to generate multiple chip selects.
- Example:
- One SS selects a demultiplexer.
- Master sends an index to choose which slave to activate.
- Second SS is routed through the demultiplexer to enable that specific slave.